package leetcode.easy;

import java.util.Arrays;
import java.util.stream.IntStream;

public class $26_RemoveDuplicates {
    public int removeDuplicates(int[] nums) {
        int j = 0;
        for (int i = 0;i < nums.length;i++) {
            if (nums[i] != nums[j]) {
                nums[++j] = nums[i];
            }
        }
        return j + 1;
    }
}
